{extend name="common:base"/}
{block name="body"}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-12">
        <h2>用户</h2>
    </div>
</div>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="panel blank-panel panel-heading background-fff">
                <div class="panel-options">
                    <ul class="nav nav-tabs">
                        <li class=''><a href="{:\\think\\Url::build('AuthManager/access',['group_id'=>$group_id])}">访问授权</a></li>
                        <li class="active"><a href="{:\\think\\Url::build('AuthManager/user',['group_id'=>$group_id])}">用户授权</a></li>
                        <li class=" pull-right">
                            <div class="btn-group pull-right">
                                <button data-toggle="dropdown" class="btn btn-default dropdown-toggle">选择用户组
                                    <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    {volist name="auth_group" id="vo"}
                                    <li><a href="{:\\think\\Url::build('AuthManager/user',['group_id'=>$vo['id']])}" class="{eq name='vo.id' value='$group_id'}font-bold{/eq}">{$vo.title}</a></li>
                                    {/volist}
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="panel-body padding-lr-0">
                    <div class="tab-content">
                        <div id="tab-2" class="tab-pane active">
                            <div class="table-responsive">
                                <table class="table table-hover">
                                    <thead>
                                        <tr>
                                            <th class="">UID</th>
                                            <th class="">昵称</th>
                                            <th class="">最后登录时间</th>
                                            <th class="">最后登录IP</th>
                                            <th class="">状态</th>
                                            <th class="">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {notempty name="list"}
                                        {volist name="list" id="vo"}
                                        <tr>
                                            <td>{$vo.uid} </td>
                                            <td>{$vo.nickname}</td>
                                            <td><span>{$vo.last_login_time|date="Y-m-d H:i:d",###}</span></td>
                                            <td><span>{$vo.last_login_ip|long2ip}</span></td>
                                            <td>{$vo.status|change_status=['禁用','正常']}</td>
                                            <td><a class="confirm ajax-get" href="{:\\think\\Url::build('AuthManager/removeFromGroup',['uid'=>$vo['uid'],'group_id'=>$group_id])}">解除授权</a></td>
                                        </tr>
                                        {/volist}
                                        {else /}
                                    <td colspan="10" class="text-center"> aOh! 暂时还没有内容! </td>
                                    {/notempty}
                                    </tbody>
                                </table>
                            </div>
                            <form class="add_user" action="{:\\think\\Url::build('AuthManager/addToGroup')}" method="post">
                                <div class="input-group pull-right  col-md-2">
                                    <input type="text" class="form-control" required="" name="uid" placeholder="请输入uid,多个用英文逗号分隔">
                                    <input type="hidden" name="group_id" value="{$group_id}">
                                    <span class="input-group-btn">
                                        <button type="submit"  class="ajax-post btn btn-primary" target-form="add_user">搜索
                                        </button>
                                    </span>
                                </div>
                            </form>
                            <div class="text-center">
                                {notempty name="list"}
                                {$page}
                                {/notempty}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    highlight_subnav("{:\\think\\Url::build('auth_manager/index')}");
</script>
{/block}